package routers

import (
	"fast-go/internal/controller"
	"fast-go/internal/middleware"
	"github.com/gin-gonic/gin"
)

// 路由注册
func Router() *gin.Engine {
	r := gin.New()
	r.Use(gin.Logger())
	r.Use(gin.Recovery())
	// validator 转中文
	r.Use(middleware.Translations())
	// 路由注册
	api := r.Group("/")
	api.GET("/index", controller.NewIndex().Index)
	return r
}
